package com.yxhl.zoume.data.http.model.specialcar;


import com.google.gson.annotations.SerializedName;

import java.io.Serializable;

/**
 * Created by vhawk on 15/11/13.
 */
public class SpecialCarPollingLatLng implements Serializable {

    @SerializedName("locType")
    private String locType;
    @SerializedName("lngLat")
    private String lngLat;

    private double lng;
    private double lat;

    private String title;


    public void parseLngLat() {

        if (lngLat != null && lngLat.length() > 0) {
            String[] locations = lngLat.split(",");
            try {
                setLng(Double.parseDouble(locations[0]));
                setLat(Double.parseDouble(locations[1]));
            } catch (Exception e) {
                setLng(0);
                setLat(0);
            }
        }
    }

    public String getLocType() {
        return locType;
    }

    public SpecialCarPollingLatLng setLocType(String locType) {
        this.locType = locType;
        return this;
    }

    public String getLngLat() {
        return lngLat;
    }

    public SpecialCarPollingLatLng setLngLat(String lngLat) {
        this.lngLat = lngLat;
        return this;
    }

    public double getLng() {
        return lng;
    }

    public SpecialCarPollingLatLng setLng(double lng) {
        this.lng = lng;
        return this;
    }

    public double getLat() {
        return lat;
    }

    public SpecialCarPollingLatLng setLat(double lat) {
        this.lat = lat;
        return this;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    @Override
    public String toString() {
        return "SpecialCarPollingLatLng{" +
                "locType='" + locType + '\'' +
                ", lngLat='" + lngLat + '\'' +
                ", lng=" + lng +
                ", lat=" + lat +
                '}';
    }


}
